import service from "@/utils/request";


//获取竞赛列表 - redis中查询
export function getExamListService(params) {
  return service({
    url: "/exam/semiLogin/redis/list",
    method: "get",
    params,
  });
}


//获取竞赛排名
export function getExamRankListService(params) {
  return service({
    url: "/exam/rank/list",
    method: "get",
    params,
  });
}


//报名竞赛
export function enterExamService(enterExamDTO) {
  return service({
    url: "/user/exam/enter",
    method: "post",
    data: enterExamDTO,
  });
}

//获取用户报名竞赛的列表
export function getMyExamListService(params = {}) {
  return service({
    url: "/user/exam/list",
    method: "get",
    params,
  });
}

//获取当前竞赛的第一题
export function getExamFirstQuestionService(examId) {
  return service({
    url: "/exam/getFirstQuestion",
    method: "get",
    params: { examId },
  });
}

//竞赛中获取上一题
export function examPreQuestionService(examId, questionId) {
  return service({
    url: "/exam/preQuestion",
    method: "get",
    params: { examId,questionId},
  });
}

//竞赛中获取下一题
export function examNextQuestionService(examId, questionId) {
  return service({
    url: "/exam/nextQuestion",
    method: "get",
    params: { examId, questionId },
  });
}